find value for all ids in row and then sum python